home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / keyb / fixpat12.zip / FIXPATH.DOC < prev   
Text File  |  1994-04-08  |  5KB  |  118 lines

  1. FixPath v1.2
  2. -------------
  3. Public Domain Software by Jean-Marc Lasgouttes.
  4.   Jean-Marc.Lasgouttes@inria.fr
  5.  
  6.  
  7. FixPath is a small TSR (96 bytes at most!) that removes the trailing
  8. backslash of directory names on the command line.  When using a
  9. command-line editor with filename completion, one often ends-up with a
  10. command like:
  11.  
  12.                     C:\>cd dos\
  13.  
  14. DOS will not accept such a command, because it does not recognize directory
  15. names that end with '\'.  Before COMMAND.COM sees it, FixPath will modify
  16. it to:
  17.  
  18.                     C:\>cd dos
  19.  
  20. You will soon find that this simple feature saves you a lot of time because
  21. you will not have to issue commands twice just because you forgot to remove
  22. the backslash of "copy *.* temp\".
  23.  
  24. There is one exception to that: when the command begins with a space
  25. character, it will not be modified by FixPath.  This allows to type
  26. complex commands flawlessly.  I have been told for example that some
  27. archivers will behave differently depending on the backslash at the
  28. end of directory names.  XCOPY is another familiar command that needs
  29. the ending \ for a purpose.
  30.  
  31.  
  32. FixPath must be installed just after your favorite command-line editor. It
  33. has been tested with Dosed v5.0 (highly recommended BTW) and should also
  34. work with CmdEdit and others.  It is not needed with Wced 1.8, since I
  35. stole the idea of FixPath from there :-) 
  36.  
  37. The installation of FixPath is as simple as typing "FixPath".  If FixPath
  38. can find a memory hole in which it can install itself, it will use no
  39. memory at all.  Otherwise, it will use a mere 96 bytes!  The only possible
  40. argument that you can specify is "/u" to uninstall FixPath from memory.
  41. Any other argument will display a short syntax help.
  42.  
  43.  
  44. Let's get technical
  45. --------------------
  46.  
  47. FixPath has been written in SPHINX C--, a freely available language written
  48. by Peter Cellik (thanks Peter!).  C-- is a sort of low-level C that allows
  49. to mix freely high-level C-like constructs and assembly instructions.  I
  50. recommend wholeheartedly that you to take a look at it.  The latest version
  51. at the time of this writing is
  52. oak.oakland.edu:/pub/msdos/misclang/c--0190a.zip.
  53.  
  54. The algorithm used to remove the '\' is the following:  FixPath will remove
  55. any backslash which is followed by a space or a carriage return if and only
  56. if it is not preceded by a space or a colon.  This takes care of most cases
  57. that I encountered.  See however the "Known bugs and limitations" section
  58. below.
  59.  
  60. What makes FixPath so small was inspired is a clever technique that I stole
  61. from the screen-saver ss_80b (garbo.uwasa.fi:/pub/pc/screen/ss_80b.zip).
  62. Instead of using the classical Terminate and Stay Resident DOS call,
  63. FixPath relocates itself into a memory block that it has allocated.  This
  64. allows to avoid the overhead of the Program Segment Prefix (which take
  65. usually 256 bytes).  I would be glad to hear of any problem this weird
  66. method may cause.
  67.  
  68. The installation check is done by inspecting the Memory Control Block chain
  69. and looking for a block named "FIXPATH" which owns itself and is not the
  70. current program.  Since FixPath writes itself its name in the MCB, this
  71. method should be safe with any version of DOS since 2.0.  However, I am not
  72. sure of what happens when the program is loaded high.
  73.  
  74.  
  75. Known bugs and limitations
  76. ---------------------------
  77.  
  78. Since FixPath has been written for my own use, it has a lot of
  79. limitations.  However, if there is some interest for the program, I will be
  80. happy to try to enhance it.  If any of these limitations is a problem for
  81. you, please let me know.  
  82.  
  83.  - the backslash are not really removed, but replaced with spaces;
  84.  
  85.  - FixPath will also do its job in programs like Debug or V. Buerg's
  86.    List.  This is not necessarily what you want.  A fix for that could be
  87.    implemented under DOS 4+, but I did not write it yet;
  88.  
  89.  - some people type "cd\" to go to the root directory.  This will be
  90.    transformed into "cd", which has a different meaning;
  91.  
  92.  - there is no visual way to see how the command line has been really
  93.    modified.  This could be a problem since the algorithm used is not
  94.    really foolproof for complex commands.  However, if you really want to know,
  95.    type "echo" in front of your command;
  96.  
  97.  - the algorithm considers only the space as a valid separator.  The
  98.    comma could be considered also;
  99.  
  100.  - text enclosed in double quotes should perhaps be skipped.
  101.  
  102.  
  103. History
  104. --------
  105.  
  106.  1.0: - Initial release.
  107.  1.1: - fixed a bug where a directory name like 'C:\' was not handled
  108.         correctly;
  109.       - changed the initialization of the program.  It uses now 96 bytes of
  110.         memory instead of 160!
  111.  1.2: - New memory allocation strategy:  FixPath is now able to fill memory
  112.         holes and will in most cases use *no* memory!
  113.       - FixPath checks whether it is already installed and refuses to
  114.         install over itself;
  115.       - new uninstall feature;
  116.       - short syntax help;
  117.       - the screen output of the program can be redirected.
  118.